package ikar.nrd.model;

import java.io.Serializable;

public class FillingRef extends StyleRef implements Serializable {
	
	private static final long serialVersionUID = 1L;
	
	private static String patternId;
	private static String rootNodeName;
	String name;
	String plateCode;
	String xpath;
	Integer id;
	Integer parentId;
	Boolean enabled;
	Boolean isMandatory;
	Boolean shortForm;
	String parentPlateCode;

	public FillingRef() {
		super();
	}

	public FillingRef(String name, String plateCode, String xpath, String patternid) {
		this.name = name;
		this.plateCode = plateCode;
		this.xpath = xpath;
		rootNodeName = xpath;
		patternId = patternid;
	}

	public FillingRef(String name, String plateCode, String xpath, boolean isStyleRefNeed) {
		this.name = name;
		this.plateCode = plateCode;
		this.xpath = xpath;
		this.setStyleRefNeed(isStyleRefNeed);
		this.setSelected(isStyleRefNeed);
	}

	public FillingRef(String name, String plateCode, String xpath, XsltNodeType nodeType) {
		this.name = name;
		this.plateCode = plateCode;
		this.xpath = xpath;
		this.setXsltNodeType(nodeType.getName());
	}

	public FillingRef(String name, String plateCode, String xpath, Integer id, Integer parentId, Boolean enabled, Boolean isMandatory, Boolean shortForm) {
		super();
		this.name = name;
		this.plateCode = plateCode;
		this.xpath = xpath;
		this.id = id;
		this.parentId = parentId;
		this.enabled = enabled;
		this.isMandatory = isMandatory;
		this.shortForm = shortForm;
	}

	public static String getPatternId(){
		return patternId == null || patternId.length() == 0 ? "PATTERN_ID" : patternId;
	}

	public static String getRootNodeName() {
		return rootNodeName == null || rootNodeName.length() == 0 ? "" : rootNodeName;
	}

	public String getParentPlateCode() {
		return parentPlateCode;
	}

	public void setParentPlateCode(String parentPlateCode) {
		this.parentPlateCode = parentPlateCode;
	}

	public String getName() {
		return name == null ? "" : name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getPlateCode() {
		return plateCode;
	}

	public void setPlateCode(String plateCode) {
		this.plateCode = plateCode;
	}

	public String getXpath() {
		return xpath;
	}

	public void setXpath(String xpath) {
		this.xpath = xpath;
	}

	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public Integer getParentId() {
		return parentId;
	}

	public void setParentId(Integer parentId) {
		this.parentId = parentId;
	}

	public Boolean getEnabled() {
		return enabled;
	}

	public void setEnabled(Boolean enabled) {
		this.enabled = enabled;
	}

	public Boolean getIsMandatory() {
		return isMandatory;
	}

	public void setIsMandatory(Boolean isMandatory) {
		this.isMandatory = isMandatory;
	}

	public Boolean getShortForm() {
		return shortForm;
	}

	public void setShortForm(Boolean shortForm) {
		this.shortForm = shortForm;
	}

}
